import axios from "axios";
import { simRight_url } from "./url";

// * 提交转换任务接口
export const submitTask = async (
  ossDownloadUrl: string,
  fileName: string
): Promise<any> => {
  return axios
    .post(simRight_url + `/task/submit`, {
      ossDownloadUrl: ossDownloadUrl,
      fileName: fileName,
    })
    .then((res: any) => res.data);
};

// * 获取转换状态接口
export const getTaskStatus = async (task_id: string): Promise<any> => {
  return axios
    .get(simRight_url + `/task/query/${task_id}`)
    .then((res: any) => res.data);
};

// * 获取是否已经转换过
export const isExist = async (fileName: string): Promise<any> => {
  return axios
    .post(simRight_url + `/file/checkResultFileExist`, {
      fileName,
    })
    .then((res: any) => res.data);
};
